Skip to content

Add IndexFlatIP, Range Search, and Reset features#4

Merged
anupammaurya6767 merged 5 commits into
mainfrom
feature/add-flat-ip-range-search-reset
Jan 11, 2026
Merged

Add IndexFlatIP, Range Search, and Reset features#4
anupammaurya6767 merged 5 commits into
mainfrom
feature/add-flat-ip-range-search-reset

Conversation

@anupammaurya6767

Copy link
Copy Markdown
Owner

Features Added

  • IndexFlatIP: Inner Product index type for cosine similarity with L2-normalized vectors
  • Range Search: Find all vectors within a specified distance radius from a query vector
  • Reset: Clear all vectors from an index while keeping the index structure

Changes

  • Added FLAT_IP index type support (C++, N-API, JS)
  • Added rangeSearch() method with async support
  • Added reset() method with async support
  • Updated TypeScript definitions
  • Added comprehensive documentation to README.md
  • Includes 'When to use FLAT_IP vs Database Cosine Functions' guidance

Documentation

  • Updated README.md with new features and usage examples
  • Added guidance on when to use FLAT_IP vs database cosine functions

RangeSearchResult was only forward declared in Index.h, causing
'incomplete type' compilation error. Added #include <faiss/utils/Heap.h>
to provide the complete type definition for RangeSearchResult.

Note: If Heap.h doesn't exist in some FAISS installations, we may need
to use a different approach or check the FAISS version.
@anupammaurya6767 anupammaurya6767 force-pushed the feature/add-flat-ip-range-search-reset branch from a7d185a to d51abb7 Compare January 11, 2026 04:12
Heap.h doesn't contain the full RangeSearchResult definition in this FAISS version.
Trying utils/distances.h which may contain range search utilities.
Heap.h and distances.h both failed. Trying AlignedTable.h which
sometimes contains FAISS utility structures.
RangeSearchResult is defined in faiss/impl/AuxIndexStructures.h,
not in utils/Heap.h or utils/distances.h. This is the correct
header for RangeSearchResult definition in FAISS.
@anupammaurya6767 anupammaurya6767 merged commit 004d5d9 into main Jan 11, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant